#define _CRT_SECURE_NO_WARNINGS 1


#include<iostream>

using namespace std;

int Add(int a, int b)
{
	return a + b;
}

int Add(int a, int b, int c)
{
	return a + b + c;
}

int Add(int a, int b, int c, int d)
{
	return a + b + c + d;
}

int main()
{
	int a = 0, b = 0, c = 0, d = 0;
	cin >> a >> b >> c >> d;
	cout << Add(a, b) << endl;
	cout << Add(a, b, c) << endl;
	cout << Add(a, b, c, d) << endl;

	return 0;
}